package com.boguan.device.mapper;

import com.boguan.device.domain.DevicePastRecords;
import com.boguan.device.domain.vo.ChartVo;
import com.boguan.device.domain.vo.DevicePastRecordsVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 设备历史记录 数据层
 *
 * @author chen
 */
public interface DevicePastRecordsMapper {
    int deleteByPrimaryKey(Long id);

    int insert(DevicePastRecords record);

    int insertSelective(DevicePastRecords record);

    DevicePastRecords selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(DevicePastRecords record);

    int updateByPrimaryKey(DevicePastRecords record);

    List<DevicePastRecordsVo> selectHistoryDataTime(@Param("deviceId") Long deviceId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<DevicePastRecordsVo> selectHistoryData(@Param("deviceId") Long deviceId, @Param("time") Date time);

    List<ChartVo> historyDataChart(@Param("deviceId") Long deviceId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<DevicePastRecordsVo> selectHistoryDataTimeNotPage(@Param("deviceId") Long deviceId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    int deleteByDeviceId(Long deviceId);

    List<ChartVo> selectParamChart(@Param("deviceId") Long deviceId, @Param("paramIds") Long[] paramId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
}